import '@/assets/style/index.scss'

import {createApp} from 'vue'

import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
import {createPinia} from 'pinia'
import ElementPlus from 'element-plus'
import zhCn from "element-plus/es/locale/lang/zh-cn";
import 'element-plus/theme-chalk/dark/css-vars.css'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import App from './App.vue'
import router from './router'

import './mock/user.ts'
import './mock/dept.ts'
import './mock/post.ts'
import './mock/role.ts'
import './mock/menu.ts'
import './mock/dictData.ts'
import './mock/dictType.ts'
import './mock/systemConfig.ts'

const app = createApp(App)

const pinia = createPinia();
pinia.use(piniaPluginPersistedstate)
app.use(pinia)

app.use(ElementPlus, {
    locale: zhCn // 全局启用中文
})
app.use(router)
app.use(ElementPlus)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.mount('#app')
